#include "GridImage.h"

#include <core/ImageMgr.h>

QPixmap BondUtility::gridImage(EnumImgFlag imgIndex) {
  QPixmap pixmap;
  switch (imgIndex) {
    case given: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_icon_gvn");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case token: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_icon_tkn");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case trade: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_icon_trd");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case change: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_icon_chg");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case tip_upload:
      break;
    case tip_refer:
      break;
    case grid_broker_1:
      break;
    case grid_broker_2:
      break;
    case grid_broker_3:
      break;
    case grid_broker_4:
      break;
    case grid_broker_5:
      break;
    case grid_broker_6:
      break;
    case grid_broker_98:
      break;
    case grid_broker_1_cn: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_broker_1_cn");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_broker_2_cn: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_broker_2_cn");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_broker_3_cn: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_broker_3_cn");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_broker_4_cn: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_broker_4_cn");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_broker_5_cn: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_broker_5_cn");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_broker_6_cn: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_broker_6_cn");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_broker_98_cn:
      break;
    case grid_broker_1_mini:
      break;
    case grid_broker_2_mini:
      break;
    case grid_broker_3_mini:
      break;
    case grid_broker_4_mini:
      break;
    case grid_broker_5_mini:
      break;
    case grid_broker_6_mini:
      break;
    case grid_broker_98_mini:
      break;
    case grid_tpsc_m_cn:
      break;
    case grid_cfic_m_cn:
      break;
    case grid_cbbj_m_cn:
      break;
    case grid_patr_m_cn:
      break;
    case grid_tjxt_m_cn:
      break;
    case grid_ueda_m_cn:
      break;
    case grid_ss_m_cn:
      break;
    case grid_cfets_m_cn:
      break;
    case grid_exchange_m_cn:
      break;
    case grid_referalbe_price:
      break;
    case grid_flag_bid:
      break;
    case grid_flag_ofr:
      break;
    case grid_update_indicator:
      break;
    case grid_remddel_normal:
      break;
    case grid_holiday_sml:
      break;
    case grid_flag_triangle: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_flag_triangle");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_holiday_sml1:
      break;
    case grid_holiday_sml2:
      break;
    case grid_holiday_sml3:
      break;
    case grid_holiday_sml4:
      break;
    case grid_holiday_sml5:
      break;
    case grid_holiday_sml6:
      break;
    case grid_holiday_sml7:
      break;
    case grid_holiday_sml8:
      break;
    case grid_holiday_sml9:
      break;
    case grid_floating_rate:
      break;
    case grid_weighted:
      break;
    case grid_broker_20:
      break;
    case grid_broker_20_cn:
      break;
    case grid_other_m_cn:
      break;
    case grid_bid_cancel: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_bid_cancel");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_tag_fullprice: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_tag_fullprice");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_tag_netprice: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_tag_netprice");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_opt_ass_en:
      break;
    case grid_opt_cal_en:
      break;
    case grid_opt_cnp_en:
      break;
    case grid_opt_cnv_en:
      break;
    case grid_opt_dcn_en:
      break;
    case grid_opt_ets_en:
      break;
    case grid_floating_rate_en:
      break;
    case grid_opt_put_en:
      break;
    case traded_20days:
      break;
    case traded_first:
      break;
    case grid_flag_oco: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_flag_oco");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_flag_upon: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_flag_upon");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_oco_upon: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_oco_upon");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_flag_reupon: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_flag_reupon");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case grid_oco_reupon: {
      SImage* img =
          ImgMgr::instance().image("widgets_grid_oco_reupon");  // TODO scale
      pixmap = QPixmap::fromImage(*img);
    } break;
    case OTHER_PIG_CLEAN_SOURTH:
      break;
    case OTHER_PIG_FULL_SOURTH:
      break;
    default:
      break;
  }
  return pixmap;
}